package org.rhok.pdx.ncn.common;

import org.rhok.pdx.ncn.R;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.widget.Toast;

public class Utils {
	public static void displayQuitDialog(final Activity a) {
		//Ask the user if they want to quit
		new AlertDialog.Builder(a)
		.setIcon(android.R.drawable.ic_dialog_alert)
		.setTitle(R.string.quit)
		.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int which) {
				a.finish();    
			}
		})
		.setNegativeButton(R.string.no, null)
		.show();
	}
	
	public static void toast(Context context, String text) {
		Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
		toast.show();
	}
}
